package base;

public class Demo05 {
    public static void main(String[] args) {
        //操作比较大的数时，注意的溢出问题
        //Jdk7 新特性数字之间可以用下划线
        int monery = 10_0000_0000;
        int years = 20;
        int total = monery*years;
        System.out.println(total);//-1474836480 计算溢出
        long total2 = monery*years; //先计算 后赋值 计算时已出现问题
        System.out.println(total2);
        long total3 = monery*(long)years;//先把一个数转换为Long
        System.out.println(total3);

    }
}
